Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <head> <script src="../../ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").nextAll().css("background-color","yellow"); }); </script> </head> <body> <p>This is a p element.</p> <div>This is a div element (next sibling of p).</div> <p>This is a p element (next sibling of p).</p> <h4>This is a h4 element (next sibling of p).</h4> <h5>This is a h5 element (next sibling of p).</h5> <p>This is a p element (next sibling of p).</p> <span>This is a span element (next sibling of p).</span> </body> <!-- Mirrored from www.w3schools.com/jquery/tryit.asp?filename=tryjquery_traversing_nextall3 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:16:05 GMT --> </html>
Result:
Try it Yourself - © w3schools.com